package org.exhaust.framework.net.client.tcp;

import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import org.exhaust.framework.net.common.protocol.RunningState;

/**
 * 客户端
 */
public interface TcpClient {

    /**
     * 连接
     *
     * @throws Exception
     */
    void connect();

    /**
     * 获取通道
     *
     * @return
     */
    Channel getChannel();

    EventLoopGroup getEventLoopGroup();

    /**
     * 程序是否在running
     *
     * @return
     */
    RunningState getState();

    /**
     * 启动
     *
     * @throws Exception
     */
    void start() throws Exception;

    /**
     * 停止
     */
    void stopGracefully();
}
